<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>公众号管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-
scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../css/weui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../css/y_index.css" />
    <style>
    .rbox {
        width: 1rem;
        height: .22rem;
        border: 1px solid #333;
    }

    .rbox1 {
        width: 1rem;
        height: .22rem;
    }

    .main_btn {
        margin-bottom: .7rem;
    }

    .scroll_list {
        white-space: nowrap;
        overflow-x: scroll;
    }
    .colc {
	    width: 50%;
	    text-align: center;
	}
    </style>
</head>

<body>
    <div class="bigBox">
        <div class="top flex_sa bw p20">
            <li class="colc active">已上架</li>
            <li class="colc">已下架</li>
        </div>
        <div class="container">
            <div class="bw mt20 wx_list">
                <!--<div class="list flex_sb p20 bdb">
                    <div class="flex_a">
                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem" />
                        <ul class="flex flex_column ml20">
                            <li>LION 公众号</li>
                            <li class="c2 mt20">已上架</li>
                        </ul>
                    </div>
                    <span class="p20 border-r4 rbox flex_aj">下架</span>
                </div>-->
                <!--<div class="list flex_sb p20 bdb touchMe">
                    <div class="flex_a">
                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem" />
                        <ul class="flex flex_column ml20">
                            <li>LION 公众号</li>
                            <li class="c2 mt20">已下架</li>
                        </ul>
                    </div>
                    <div class="flex_a">
                        <span class="p20 border-r4 rbox flex_aj">编辑</span>
                        <span class="p20 border-r4 colw rbox1 flex_aj ml20 b_diy1">上架</span>
                    </div>
                </div>-->
                <div class="weui-cell_swiped" style="position: relative;">
			    	<div class="list flex_sb p20 bdb weui-cell__bd">
	                    <div class="flex_a">
	                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem" />
	                        <ul class="flex flex_column ml20">
	                            <li>LION 公众号</li>
	                            <li class="c2 mt20">已上架</li>
	                        </ul>
	                    </div>
	                    <span class="p20 border-r4 rbox flex_aj">下架</span>
	                </div>
			    	<div class="weui-cell__ft">
			        <a class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout flex_a" href="javascript:">删除</a>
			      </div>
			    </div>
			    <div class="weui-cell_swiped" style="position: relative;">
			    	<div class="list flex_sb p20 bdb touchMe weui-cell__bd">
	                    <div class="flex_a">
	                        <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem" />
	                        <ul class="flex flex_column ml20">
	                            <li>LION 公众号</li>
	                            <li class="c2 mt20">已下架</li>
	                        </ul>
	                    </div>
	                    <div class="flex_a">
	                        <span class="p20 border-r4 rbox flex_aj">编辑</span>
	                        <span class="p20 border-r4 colw rbox1 flex_aj ml20 b_diy1">上架</span>
	                    </div>
	                </div>
			    	<div class="weui-cell__ft">
			        <a class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout flex_a" href="javascript:">删除</a>
			      </div>
			    </div>
            </div>
             
        </div>
        <div class="main_btn">添加公众号</div>
    </div>
</body>

</html>
<script src="../js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/dlc.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.0/alipayjsapi.inc.min.js"></script>
<script src="../js/swipeout.js" type="text/javascript" charset="utf-8"></script>
<!--公司的常用函数封装-->
<script type="text/javascript">
$('.top').on('click', 'li', function() {
    $(this).addClass('active').siblings().removeClass('active');
    wx_list($(this).index()+1,1)
})
// 长按删除
//$(".touchMe").on({
//  touchstart: function(e) {
//      var index = $(this).index();
//      console.log(index);
//
//      // 将当前元素的索引作为参数进行传递
//      timeOutEvent = setTimeout("longPress(" + index + ")", 500);
//      e.preventDefault();
//  },
//  touchmove: function() {
//      clearTimeout(timeOutEvent);
//      timeOutEvent = 0;
//  },
//  touchend: function() {
//      clearTimeout(timeOutEvent);
//      if (timeOutEvent != 0) {
//          alert('你这是点击，不是长按');
//      }
//      return false;
//  }
//})
//
//function longPress(t) {
//  timeOutEvent = 0;
//  if (confirm('您确定要删除？' + t)) {
//      // 用传递过来的参数定位当前元素
//      $('.touchMe').eq(0).remove();
//      console.log('已删除');
//  }
//}
$('.main_btn').on('click', function() {
    location.href = 'ser_addWechat.html?deviceNo='+getUrlParam('deviceNo')
})

//滑动删除
$('.weui-cell__ft').on('click','a',function () {
	console.log($(this).index())
  	$(this).parents('.weui-cell_swiped').remove()
  })



wx_list(1,1)
function wx_list(id,page){
	$.ajax({
		type:"post",
		url:dlcUrl()+"/api/officialAccounts/list",
		dataType: 'json',
		data:{deviceNo:getUrlParam('deviceNo'),status:id,page:page,limit:10},
		success: function(res) {
			console.log(res)
			html += '<div class="weui-cell_swiped" style="position: relative;">'
			    	'<div class="list flex_sb p20 bdb weui-cell__bd">'
	                    '<div class="flex_a">'
	                       ' <img src="../img/y_8.png" style="width: 1.5rem;height: 1.5rem" />'
	                        '<ul class="flex flex_column ml20">'
	                            '<li>LION 公众号</li>'
	                            '<li class="c2 mt20">已上架</li>'
	                        '</ul>'
	                    '</div>'
	                    '<span class="p20 border-r4 rbox flex_aj">下架</span>'
	                '</div>'
			    	'<div class="weui-cell__ft">'
			        '<a class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout flex_a" href="javascript:">删除</a>'
			      '</div>'
			    '</div>'
		}
	});
}
</script>